
class LoftOptions(dict):
    '''The LoftOptions class stores parameter values used to control how a 
       lofting surface between multiple 3D curves is created. 
    '''
    Add_caps = ("add_caps", int)
    Bias = ("bias", int)
    Continuity = ("continuity", int)

    Linear_multiplier = ("linear_multiplier", int)
    Method = ("method", str)

    Num_modes = ("num_modes", int)
    Num_out_pts_along_length = ("num_out_pts_along_length", int)
    Num_out_pts_in_segs = ("num_out_pts_in_segs", int)
    Num_pts_in_linear_sample_along_length = ("num_pts_in_linear_sample_along_length", int)
    Num_super_pts = ("num_super_pts", int)

    Sample_per_segment = ("sample_per_segment", int)
    Spline_type = ("spline_type", int)
    Tension = ("tension", int)

    U_degree = ("u_degree", int)
    V_degree = ("v_degree", int)

    U_knot_span_type = ("u_knot_span_type", str)
    V_knot_span_type = ("v_knot_span_type", str)
    U_parametric_span_type = ("u_parametric_span_type", str)
    V_parametric_span_type = ("v_parametric_span_type", str)

    Use_linear_sample_along_length = ("use_linear_sample_along_length", int)
    Use_fft = ("use_fft", int)
    Vec_flag = ("vec_flag", int)

    def __init__(self):
      super().__setitem__(self.Add_caps[0], 0)
      super().__setitem__(self.Bias[0], 0)
      super().__setitem__(self.Continuity[0], 0)

      super().__setitem__(self.Linear_multiplier[0], 10)
      super().__setitem__(self.Method[0], "nurbs")

      super().__setitem__(self.Num_modes[0], 20)
      super().__setitem__(self.Num_out_pts_along_length[0], 0)
      super().__setitem__(self.Num_out_pts_in_segs[0], 60)
      super().__setitem__(self.Num_pts_in_linear_sample_along_length[0], 0)
      super().__setitem__(self.Num_super_pts[0], 0)

      super().__setitem__(self.Sample_per_segment[0], 12)
      super().__setitem__(self.Spline_type[0], 0)
      super().__setitem__(self.Tension[0], 0)

      super().__setitem__(self.U_degree[0], 2)
      super().__setitem__(self.V_degree[0], 2)

      super().__setitem__(self.U_knot_span_type[0], "average")
      super().__setitem__(self.V_knot_span_type[0], "average")
      super().__setitem__(self.U_parametric_span_type[0], "chord")
      super().__setitem__(self.V_parametric_span_type[0], "chord")

      super().__setitem__(self.Use_linear_sample_along_length[0], 1)
      super().__setitem__(self.Use_fft[0], 0)
      super().__setitem__(self.Vec_flag[0], 0)

    def __setitem__(self, index, value):
        None 

    #------------------------------------------------------------

    @property 
    def add_caps(self):
        '''Cap the ends of the lofted surface to form a solid model.
        '''
        return super().__getitem__(self.Add_caps[0])

    @add_caps.setter
    def add_caps(self, value):
        super().__setitem__(self.Add_caps[0], value)

    #------------------------------------------------------------

    @property
    def bias(self):
        return super().__getitem__(self.Bias[0])

    @bias.setter
    def bias(self, value):
        super().__setitem__(self.Bias[0], value)

    #------------------------------------------------------------

    @property
    def continuity(self):
        return super().__getitem__(self.Continuity[0])

    @continuity.setter
    def continuity(self, value):
        super().__setitem__(self.Continuity[0], value)

    #------------------------------------------------------------

    @property
    def linear_multiplier(self):
        return super().__getitem__(self.Linear_multiplier[0])

    @linear_multiplier.setter
    def linear_multiplier(self, value):
        super().__setitem__(self.Linear_multiplier[0], value)

    #------------------------------------------------------------

    @property
    def method(self):
        '''Set the lofing method. 
         
           method(str): 'nurbs' or 'spline'
	'''
        return super().__getitem__(self.Method[0])

    @method.setter
    def method(self, value):
        if value not in ['nurbs' , 'spline']:
            raise Exception("Unknown method '{0:s}' given. Valid methods are: nurbs and spline".format(value))
        super().__setitem__(self.Method[0], value)

    #------------------------------------------------------------

    @property
    def num_modes(self):
        return super().__getitem__(self.Num_modes[0])

    @bias.setter
    def num_modes(self, value):
        super().__setitem__(self.Num_modes[0], value)

    #------------------------------------------------------------

    @property
    def num_out_pts_along_length(self):
        return super().__getitem__(self.Num_out_pts_along_length[0])

    @num_out_pts_along_length.setter
    def num_out_pts_along_length(self, value):
        super().__setitem__(self.Num_out_pts_along_length[0], value)

    #------------------------------------------------------------

    @property
    def num_out_pts_in_segs(self):
        return super().__getitem__(self.Num_out_pts_in_segs[0])

    @num_out_pts_in_segs.setter
    def num_out_pts_in_segs(self, value):
        super().__setitem__(self.Num_out_pts_in_segs[0], value)

    #------------------------------------------------------------

    @property
    def num_pts_in_linear_sample_along_length(self):
        return super().__getitem__(self.Num_pts_in_linear_sample_along_length[0])

    @num_pts_in_linear_sample_along_length.setter
    def num_pts_in_linear_sample_along_length(self, value):
        super().__setitem__(self.Num_pts_in_linear_sample_along_length[0], value)

    #------------------------------------------------------------

    @property
    def num_super_pts(self):
        return super().__getitem__(self.Num_super_pts[0])

    @num_super_pts.setter
    def num_super_pts(self, value):
        super().__setitem__(self.Num_super_pts[0], value)

    #------------------------------------------------------------

    @property
    def sample_per_segment(self):
        return super().__getitem__(self.Sample_per_segment[0])

    @sample_per_segment.setter
    def sample_per_segment(self, value):
        super().__setitem__(self.Sample_per_segment[0], value)

    #------------------------------------------------------------

    @property
    def spline_type(self):
        return super().__getitem__(self.Spline_type[0])

    @spline_type.setter
    def spline_type(self, value):
        super().__setitem__(self.Spline_type[0], value)

    #------------------------------------------------------------

    @property
    def tension(self):
        return super().__getitem__(self.Tension[0])

    @tension.setter
    def tension(self, value):
        super().__setitem__(self.Tension[0], value)

    #------------------------------------------------------------

    @property
    def u_degree(self):
        return super().__getitem__(self.U_degree[0])

    @u_degree.setter
    def u_degree(self, value):
        super().__setitem__(self.U_degree[0], value)

    #------------------------------------------------------------

    @property
    def v_degree(self):
        return super().__getitem__(self.V_degree[0])

    @v_degree.setter
    def v_degree(self, value):
        super().__setitem__(self.V_degree[0], value)

    #------------------------------------------------------------

    @property
    def u_knot_span_type(self):
        return super().__getitem__(self.U_knot_span_type[0])

    @u_knot_span_type.setter
    def u_knot_span_type(self, value):
        super().__setitem__(self.U_knot_span_type[0], value)

    #------------------------------------------------------------

    @property
    def v_knot_span_type(self):
        return super().__getitem__(self.V_knot_span_type[0])

    @v_knot_span_type.setter
    def v_knot_span_type(self, value):
        super().__setitem__(self.V_knot_span_type[0], value)

    #------------------------------------------------------------

    @property
    def u_parametric_span_type(self):
        return super().__getitem__(self.U_parametric_span_type[0])

    @u_parametric_span_type.setter
    def u_parametric_span_type(self, value):
        super().__setitem__(self.U_parametric_span_type[0], value)

    #------------------------------------------------------------

    @property
    def v_parametric_span_type(self):
        return super().__getitem__(self.V_parametric_span_type[0])

    @v_parametric_span_type.setter
    def v_parametric_span_type(self, value):
        super().__setitem__(self.V_parametric_span_type[0], value)

    #------------------------------------------------------------

    @property
    def use_linear_sample_along_length(self):
        return super().__getitem__(self.Use_linear_sample_along_length[0])

    @use_linear_sample_along_length.setter
    def use_linear_sample_along_length(self, value):
        super().__setitem__(self.Use_linear_sample_along_length[0], value)

    #------------------------------------------------------------

    @property
    def use_fft(self):
        return super().__getitem__(self.Use_fft[0])

    @use_fft.setter
    def use_fft(self, value):
        super().__setitem__(self.Use_fft[0], value)

    #------------------------------------------------------------

    @property
    def vec_flag(self):
        return super().__getitem__(self.Vec_flag[0])

    @vec_flag.setter
    def vec_flag(self, value):
        super().__setitem__(self.Vec_flag[0], value)


